﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Summary.aspx.cs" Inherits="CommentPost.Summary" %>
<%@ Import Namespace="CommentPost" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Who was nice and who was naughty</title>
    <link rel="stylesheet" href="StyleSheet1.css" />
</head>
<body>
    <h2>Summary</h2>
    <h3>Folks that like my blog:</h3>
   <table>
        <thead>
            <tr><th>Name</th><th>Email</th></tr>
        </thead>
        <tbody>
            <%
                IEnumerable<Comment> likes =
                   CommentsCollection.GetCommentsCollection().GetAllComments().Where(r => r.LikedPost.HasValue && r.LikedPost.Value);
                   
               foreach (Comment comment in likes)
               {
                   string html =
                       string.Format("<tr><td>{0}</td><td>{1}</td>", comment.PosterName, comment.PosterEmail);
                   Response.Write(html);
               }
            %>
        </tbody>
    </table>
    
    <h3>Folks that did not like my blog:</h3>
    <table>
        <thead>
            <tr><th>Name</th><th>Email</th></tr>
        </thead>
        <tbody>
            <%= DidNotLikeMyBlog() %>
        </tbody>
    </table>
    

</body>
</html>
